import React,{Fragment} from 'react';
import { baseRoutes } from 'routes'
import { Switch, Route, Redirect } from 'react-router-dom'
import Admin from 'pages/Admin'


function App() {
  return (
    <Fragment>
      <Switch>
        <Route path='/admin' component={Admin} />
      {
        baseRoutes.map(route => {
          return (
            <Route
            key = {route.path}
            path = {route.path}
            component = {route.component}
            />
          )
        })
      }
      <Redirect to = '/admin' from='/' exact />
      <Redirect to = '/404' />
      </Switch>
    </Fragment>
  );
}

export default App;
